#include <stdio.h>
#include <unistd.h>
#include <signal.h>

void handler(int arg){
	printf("收到了闹钟信号\n");
}

int main(int argc,const char *argv[])
{
	signal(SIGALRM,handler);
	alarm(5);
	sleep(3);
	int ret = alarm(3);
	printf("ret=%d\n",ret);
	while(1){
		pause();
		printf("hello world\n");
		sleep(1);
	}
	return 0;
}
